package com.zim.aliot.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zim.aliot.dao.ReactiveVehicleRepository;
import com.zim.aliot.service.ReactiveVehicleService;
import com.zim.aliot.vo.VehicleVO;

import lombok.extern.slf4j.Slf4j;
import reactor.core.publisher.Mono;

@Service
@Slf4j
public class ReactiveVehicleServiceImpl implements ReactiveVehicleService {

    @Autowired
    private ReactiveVehicleRepository reactiveVehicleRepository;
    
    @Override
    public void save(VehicleVO vehicleVO) {
        log.info("要保存的数据:{}",vehicleVO);
        Mono<VehicleVO> res = reactiveVehicleRepository.save(vehicleVO);
        res.subscribe(resData->{
           log.warn("[保存数据]:{}",resData);
        });
    }

}
